//处理时间戳的方法
export function formatDateTime(inputTime){
    var date = new Date(inputTime);
    var y = date.getFullYear();
    var m = date.getMonth()+1;
    m = m < 10 ? ('0'+ m) : m;
    var d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    // var h = date.getHours();
    // h = h < 10 ? ('0' + h) : h;
    // var minute = date.getMinutes();
    // var second = date.getSeconds();
    // minute = minute < 10 ? ('0' + minute) : minute;
    // second = second < 10 ? ('0' + second) : second;
    return y +'年' + m + '月' + d + '日';
}

//处理时间段的方法
export function timeFormat (data){
    // 187076 变成 03:20
    var minutes = parseInt((data % (1000 * 60 * 60)) / (1000 * 60));
    if(minutes<10){
        minutes = '0' + minutes
    }
    var seconds = parseInt((data % (1000 * 60)) / 1000);
    if(seconds<10){
        seconds = '0' + seconds
    }
    return minutes + ':' + seconds
}

// var toHHmmss = function (data) {
//     var s;
//     var hours = parseInt((data % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
//     var minutes = parseInt((data % (1000 * 60 * 60)) / (1000 * 60));
//     var seconds = (data % (1000 * 60)) / 1000;
//     s = (hours < 10 ? ('0' + hours) : hours) + ':' + (minutes < 10 ? ('0' + minutes) : minutes) + ':' + (seconds < 10 ? ('0' + seconds) : seconds);
//     return s;
// };

// var MODECONTENT = {
// toHHmmss: toHHmmss,//毫秒整数转化为时分秒（例如：00:30:00）



//秒变成  00:00
export function fromTimeOne(m){
    //分钟
    let minute = m/60
    let  minutes = parseInt(minute)
    //当小于10的时候
    if(minutes<10){
        minutes = '0' + minutes
    }
    //秒钟
    let second = m%60
    let seconds = parseInt(second)
    if(seconds<10){
        seconds = '0' + seconds
    }
    return `${minutes}:${seconds}`
}